import u from "../utils";
import { CUSPATH } from "../constants";
const _api = u.api(CUSPATH);
export default {
    versionNode: id => _api('getVersionNodeInfo', { data: { id } }),
    saveNode: params => _api('saveVersionNodeInfo', { data: params, type: 'post' }),
    toggleCombine: params => _api('togglePathCombine', { data: params }),
    getFormAndFields: params => _api('getFormAndFields', { data: params }),
    getFormfieldprops: params => _api('getFormfieldprops',{data: params}),
    saveFormfieldprops: params =>_api('saveFormfieldprops',{data: params, type: 'post'}),
    saveCombineSet: params => _api('saveCombineSet', { data: params, type: 'post' }),
    deleteChildren: nodeid => _api('deleteCustomNodeChildren', { data: { nodeid } }),
    saveAsTemplate: params => _api('saveAsTemplate', { data: params, type: 'post' }),
    loadTemplate: params => _api('loadTemplate', { data: params }),
    allChildOpreator: nodeid => _api('allChildOpreator', { data: { nodeid } }),
    updateNode: params => _api('updateNode', { data: params }),
    synchronizeNode: params => _api('synchronizeNode',{data:params}),
    getOperateMenu:params => _api('getOperateMenu',{data:params}),
    setOperateMenu:params => _api('setOperateMenu',{data:params,type:'post'}),
    getJoinCubeSetting:params => _api('getJoinCubeSetting',{data:params}),
    saveJoinCubeSetting:params => _api('saveJoinCubeSetting',{data:params,type:'post'}),
    getBeforeNodeOperateDefault:params => _api('getBeforeNodeOperateDefault',{data:params}),
    setBeforeNodeOperateDefault:params => _api('setBeforeNodeOperateDefault',{data:params,type:'post'}),
    addDynamicChild:params => _api('addDynamicChild',{data:params,type:'post'}),
    dynamicOperatorList:id => _api('dynamicOperatorList', { data: { id }, type: 'get' }),
    getDynamicNodePreviewList:id => _api('getDynamicNodePreviewList', { data: { id }, type: 'get' }),
}
export const template = id => _api('template', { data: { id } });